﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.HRM
{
    [Table("hrm_system_controls")]
    public class HrmSystemControls
    {
        [DataMember, Key, DatabaseGenerated(DatabaseGeneratedOption.Identity), Column("id")]
        public int Id { get; set; }

        [DataMember, Column("name")]
        public string Name { get; set; }

        [DataMember, Column("value")]
        public string Value { get; set; }

        public int GetInt()
        {
            return Class.ConvertUtility.ConvertOrDefaultObjectInt(Value);
        }
        public bool GetBoolean()
        {
            return Class.ConvertUtility.ConvertOrDefaultObjectToBool(Value);
        }
        public float GetFloat()
        {
            return Class.ConvertUtility.ConvertOrDefaultObjectFloat(Value);
        }
        public TimeSpan GetTimeSpan()
        {
            return Class.ConvertUtility.ConvertOrDefaultObjectTimeSpan(Value);
        }
    }
}
